<!DOCTYPE html>
<html lang="cn">

<head>
    <title></title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- <script src="/test/es6-import.test/entry.bundle.js"></script> -->
    <script src="/dist/fetch-source.js"></script>
</head>

<body>
    <button id="connect" type="button">connect</button>
    <button id="get" type="button">fetch</button>

    <script>
        const videoId = '123';
        const server = 'http://10.100.5.113:8800';
        let fs = null;

        document.getElementById('connect').addEventListener('click', function () {
            fs = new fetchSource(server, videoId, {
                cacheSize: 419430400 * 5
            });
        });


        document.getElementById('get').addEventListener('click', function () {
            fs.seed.addPart('123', 'XXXX.ts', 'XXXX', new ArrayBuffer(419430400), fetchSource.CDN);
        });
    </script>
</body>

</html>